//Header file definition for creating Orthonormal bases given vectors
//Material source: Raytracing by Peter Shirley.
#ifndef __ONB_H__
#define __ONB_H__

#pragma once
#include "Vector.h"

class ONB
{
public:
	Vector3 u,v,w;		// the three basis vectors of the ONB

	//Constructors
	ONB();
	ONB(const Vector3& a, const Vector3& b, const Vector3& c);	//assuming that all three are orthonormal

	//construct from a given vector, parallel to this
	void ConstructFromU(const Vector3& parallel_u);	
	void ConstructFromV(const Vector3& parallel_v);
	void ConstructFromW(const Vector3& parallel_w);

	//construct from two vectors, parallel to first and using the next for finding other two vectors
	void ConstructFromUV(const Vector3& parallel_u, const Vector3& v);
	void ConstructFromVU(const Vector3& parallel_v, const Vector3& u);
	void ConstructFromVW(const Vector3& parallel_v, const Vector3& w);
	void ConstructFromWV(const Vector3& parallel_w, const Vector3& v);
	void ConstructFromUW(const Vector3& parallel_u, const Vector3& w);
	void ConstructFromWU(const Vector3& parallel_w, const Vector3& u);
};

#endif